package clue_utils

import "time"

// 返回时间
func GetSpecTime(a int, is_tomorrow bool) time.Time {
	now := time.Now()
	tomorrow := now.Add(24 * time.Hour)
	var targetDate time.Time
	if is_tomorrow {
		targetDate = tomorrow
	} else {
		targetDate = now
	}
	targetTime := time.Date(targetDate.Year(), targetDate.Month(), targetDate.Day(), a, 0, 0, 0, targetDate.Location())
	return targetTime
}

func ReturnTimeRange(a, b int) (time.Time, time.Time) {
	startTime := GetSpecTime(a, false)
	var endTime time.Time
	if a < b {
		endTime = GetSpecTime(b, false)
	} else {
		endTime = GetSpecTime(b, true)
	}
	return startTime, endTime
}
